# a = int(input('输入年份:'))
# if a % 4 == 0 and a % 100 != 0 or a % 400 == 0:
#     print('a是闰年')
# else :
#     print('a不是闰年')
#计算100的阶乘
# num = 1
# ret = 1
# while num <= 100 :
#      ret *= num
#      num += 1
# print(ret)
from random import random

# for i in range(1,100) :
#     print(i)
# import random
#
# print('***********************************')
# print('******** 欢迎来到人生重开模拟器 *******')
# print('***********************************')
#
# # def property(string) :
# #     while True :
# #         print('在[0,10]范围内输入')
# #         tmp = int(input(f'{string}:'))
# #         if tmp < 0 or tmp > 10 :
# #             print('输入有误,请重新输入')
# #         else :
# #             return tmp
#
#
# def getnum() :
#     return random.randint(1,10)
#
#
# facial = getnum()
# high = getnum()
# age =  getnum()
# home = getnum()
#
# cur = getnum()
# sex = '女'
# if cur % 2 == 0 :
#     sex = '男'
#
# print('当前默认属性为:')
# print(f'性别:{sex},颜值:{facial},身高:{high},年龄:{age},家境:{home}')

# a = []
# for i in range(0,100) :
#     a.append(i)
#
#
# a.append('1')
# print(type(a[100]))
#
#
# for i in a :
#     print(i)

# a = [1,1,1,1,1]
# a.remove(1)
# print(a)
# b = [2,2,2,2]
# a.extend(b)
# print(a)
# print(a + b)

# a = {
#     'a' : 1
#     ,'b' : 2
# }
# print(a)
# print('a' in a)
# b = [1,2,3,4]
# c = b.index(1)
# print(b[c])
# print(f'''{a['a']},{a['b']}''')

# a = {
#     'a' : 1
#     ,'b' : 2
# }
# for i in a:
#     print(a[i])
#
#
# print(a.keys())
# print(a.values())
# print(a.items())
#
# for i,j in a.items() :
#      print(i,j)


# f = open('./text.txt','w')
# for i in range(0,100) :
#     f.write(f'{i}\n')
# f.close()
#
# t = open('./text.txt','r')
# a = t.readlines()
# print(a)
# t.close()
# with open('./text.txt','r') as f :
#     a = f.readlines()
#     print(a)
#
# import datetime as dt
# a = dt.datetime(year=2024,month=8,day=25)
# b = dt.datetime(year=2024,month=12,day=24)
# print(b - a)

# a = 'a b a n d o n'
# b = []
# for i in a :
#     b.append(i)
#
# print(b[::-1])
# print(a[::-1])
#简易文本搜索
# import os
# a = 'D:\c语言\gitee仓库\linux'
# b = '.'
# for mkdir,_,filename in os.walk(a) :
#     for f in filename :
#         if b in f :
#             print(f'{mkdir}/{f}')

#生成二维码
# import qrcode as qr
#
# a = qr.make('我是张三')
# a.save('test.jpg')


import xlrd
import xlwt


name = {}

with xlrd.open_workbook('./21.1班名单.xlsx') as f :
    #获取页码
    t = f.sheet_by_index(0)
    #获取行数
    n = t.nrows
    m = t.ncols

    for i in range(3,n) :
        name[t.cell_value(i,1)] = t.cell_value(i,0)

print(name)

f = xlwt.Workbook()
q = f.add_sheet('name')
num = 0
for a,b in name.items() :
    q.write(num,0,a)
    q.write(num,1,b)
    num += 1
f.save('./name.xls')





